package cn.dankal.flyaudio.configs;

import java.util.ArrayList;
import java.util.List;

import cn.dankal.basiclib.DKUserManager;
import cn.dankal.basiclib.pojo.UserInfoBean;
import cn.dankal.basiclib.pojo.UserResponseBody;
import cn.dankal.flyaudio.entity.ContractPersonEntity;
import cn.dankal.flyaudio.entity.GroupEntity;
import cn.dankal.flyaudio.entity.SignRewardEntity;

public class TestData {

    /**
     * b5def87af86ae8649e449c
     * <p>
     * <p>
     * 5afbdf6549321ab83dab5b
     * <p>
     * 260a30d783fdbe5a75db5f
     *
     * @return
     */

    public static final String USER1 = "b5def87af86ae8649e449c";

    public static final String USER2 = "5afbdf6549321ab83dab5b";

    public static final String USER3 = "260a30d783fdbe5a75db5f";

    public static final int USE_USER1 = 1001;

    public static final int USE_USER2 = 1002;

    public static final int USE_USER3 = 1003;

    public static int currentUser = USE_USER3;

    public static void updateUse(String token) {
        UserResponseBody userResponseBody = new UserResponseBody();
        UserResponseBody.TokenBean tokenBean = new UserResponseBody.TokenBean();
        UserInfoBean userInfoBean = new UserInfoBean();
        userInfoBean.setAccessToken(token);
        tokenBean.token = userInfoBean.getAccessToken();
        userResponseBody.setToken(tokenBean);
        userResponseBody.setUserInfo(userInfoBean);
        DKUserManager.saveUserInfo(userResponseBody);
        DKUserManager.updateUserInfo(userInfoBean);
    }

    public static void setUser(int useType) {
        if (useType == USE_USER1) {
            currentUser = USE_USER1;
            updateUse(getUser(currentUser));
        } else if (useType == USE_USER2) {
            currentUser = USE_USER2;
            updateUse(getUser(currentUser));
        } else if (useType == USE_USER3) {
            currentUser = USE_USER3;
            updateUse(getUser(currentUser));
        }
    }


    public static String getUser(int useType) {
        if (useType == USE_USER1) {
            return USER1;
        } else if (useType == USE_USER2) {
            return USER2;
        } else if (useType == USE_USER3) {
            return USER3;
        } else {
            return USER3;
        }
    }

    public static List<SignRewardEntity> getTestData() {
        List<SignRewardEntity> list = new ArrayList<>();
        SignRewardEntity entity1 = new SignRewardEntity();
        entity1.setDay("1");
        entity1.setScores("1");
        SignRewardEntity entity2 = new SignRewardEntity();
        entity2.setDay("2");
        entity2.setScores("2");
        SignRewardEntity entity3 = new SignRewardEntity();
        entity3.setDay("3");
        entity3.setScores("3");
        SignRewardEntity entity4 = new SignRewardEntity();
        entity4.setDay("4");
        entity4.setScores("4");
        SignRewardEntity entity5 = new SignRewardEntity();
        entity5.setDay("5");
        entity5.setScores("5");

        list.add(entity1);
        list.add(entity2);
        list.add(entity3);
        list.add(entity4);
        list.add(entity5);

        return list;
    }

//    public static List<GroupEntity> getContractPerson(){
////        List<GroupEntity> list = new ArrayList<>();
////        ContractPersonEntity entity = new ContractPersonEntity();
////        List<ContractPersonEntity> entityList = new ArrayList<>();
////        entityList.add(entity);
////        entityList.add(entity);
////        entityList.add(entity);
////        GroupEntity groupEntity = new GroupEntity();
////        groupEntity.setHeader("A");
////        groupEntity.setChildren(entityList);
////        list.add(groupEntity);
////        GroupEntity groupEntity2 = new GroupEntity();
////        groupEntity2.setHeader("B");
////        groupEntity2.setChildren(entityList);
////        list.add(groupEntity2);
////        GroupEntity groupEntity3 = new GroupEntity();
////        groupEntity3.setHeader("C");
////        groupEntity3.setChildren(entityList);
////        list.add(groupEntity3);
////        GroupEntity groupEntity4 = new GroupEntity();
////        groupEntity4.setHeader("D");
////        groupEntity4.setChildren(entityList);
////        list.add(groupEntity4);
////        GroupEntity groupEntity5 = new GroupEntity();
////        groupEntity5.setHeader("E");
////        groupEntity5.setChildren(entityList);
////        list.add(groupEntity5);
//        return list;
//    }
}
